package com.hdax.dm.rest.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hdax.dm.dao.scheduler.DmSchedulerSeatPriceMapper;
import com.hdax.dm.entity.scheduler.DmSchedulerSeatPrice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(path = "/rest/schedulerSeatPrice")
@Api(value = "排期座位票价接口",tags = "排期座位票价接口")
public class DmSchedulerSeatPriceRestService {

    @Resource
    private DmSchedulerSeatPriceMapper dmSchedulerSeatPriceMapper;


    @ApiOperation(value = "查询排期价格集合（根据排期id）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "schedulerId", required = true, type = "long")
    })
    @PostMapping(path = "/getPrice")
    public List<DmSchedulerSeatPrice> getPrice(@RequestParam(value = "schedulerId")Long schedulerId){
        QueryWrapper<DmSchedulerSeatPrice> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("scheduleId",schedulerId);
        return dmSchedulerSeatPriceMapper.selectList(queryWrapper);
    }
}
